
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of CSVINFO.CGI</TITLE>
</HEAD><BODY>
<H1>CSVINFO.CGI</H1>
Section: User Commands  (1)<BR>Updated: Version 4.3.13:  7 Jan 2014<BR><A HREF="#index">Index</A>
<A HREF="../index.html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

csvinfo.cgi - CGI program to show host information from a CSV file
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>csvinfo.cgi</B>

<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

<B>csvinfo.cgi</B>
is invoked as a CGI script via the csvinfo.sh CGI wrapper.
Based on the parameters it receives, it searches a comma-
separated file for the matching host, and presents the information
found as a table.
<P>
csvinfo.cgi is passed a QUERY_STRING environment variable 
with the following parameters:
<P>
<BR>&nbsp;&nbsp;&nbsp;key&nbsp;(string&nbsp;to&nbsp;search&nbsp;for,&nbsp;typically&nbsp;hostname)
<BR>&nbsp;&nbsp;&nbsp;column&nbsp;(columnnumber&nbsp;to&nbsp;search&nbsp;-&nbsp;default&nbsp;0)
<BR>&nbsp;&nbsp;&nbsp;db&nbsp;&nbsp;(name&nbsp;of&nbsp;the&nbsp;CSV&nbsp;database&nbsp;file&nbsp;in&nbsp;$XYMONHOME/etc/,&nbsp;default&nbsp;hostinfo.csv)
<BR>&nbsp;&nbsp;&nbsp;delimiter&nbsp;(delimiter&nbsp;character&nbsp;for&nbsp;columns,&nbsp;default&nbsp;semi-colon)
<P>
CSV files are easily created from e.g. spreadsheets, by exporting them
in CSV format. You should have one host per line, with the first line
containing the column headings. Despite their name, the default delimiter
for CSV files is the semi-colon - if you need a different delimiter, 
invoke csvinfo.cgi with the &quot;delimiter=&lt;character&gt;&quot; in the query
string.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>Example usage</H2>

This example shows how you can use the csvinfo CGI. It assumes
you have a CSV-formatted file with information about the hosts stored
as $XYMONHOME/etc/hostinfo.csv, and the hostname is in the first column
of the file.
<P>
<DL COMPACT>
<DT>Use with the xymongen --docurl<DD>
The --docurl option to
<I><A HREF="../man1/xymongen.1.html">xymongen</A>(1)</I>

sets up all of the hostnames on your Xymon webpages to act as links to
a CGI script. To invoke the csvinfo CGI script, run xymongen with the
option
<P>
<BR>&nbsp;&nbsp;&nbsp;--docurl=/cgi-bin/csvinfo.sh?db=hostinfo.csv&amp;key=%s
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>

<A HREF="../man5/hosts.cfg.5.html">hosts.cfg</A>(5), <A HREF="../man5/xymonserver.cfg.5.html">xymonserver.cfg</A>(5), <A HREF="../man1/xymongen.1.html">xymongen</A>(1)
<P>
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">Example usage</A><DD>
<DT><A HREF="#lbAF">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 09:25:35 GMT, January 07, 2014
</BODY>
</HTML>
